let cq = {
	cR : 100,   // 暴击
	attack : 2000,  // 攻击力
	cD : 160,  // 爆伤
	dR : 46.6 + 15 + 30 + 80 + 28.8, // 水杯 水2 水4 弓藏 角色突破
	fy : 1,   // 反应倍率
	jT : 0,   // 精通 
	jk : 0,  // 减抗 
	jf : 0,   // 减防
	rate: 1,   // 技能倍率
	other: 1   // 额外倍率 
}

let ck = getCK(cq);
let dk = getDK(cq);
let jT = jt(cq.jT);
let jK = q(cq);
let jf = df(80,88,cq.jf);
console.log({
	"暴击系数" :ck,
	"增伤系数":dk,
	"反应系数":jT,
	"减抗系数":jK,
	"防御系数":jf,
	"技能倍率":cq.rate
});
console.log(ck*dk*jT*jK*jf*cq.rate*cq.fy*cq.other);
console.log(cq.attack*ck*dk*jT*jK*jf*cq.rate*cq.fy*cq.other);
function getCK(p){
	let {cR,cD} = p;
	return (1-((cR>100?100:cR)/100)+((cR>100?100:cR)/100)*(1+cD/100))
}

function getDK(p){
	return 1 + p.dR/100
}

function q (p) {
	let resistance = 10 - p.jk
    if(resistance < 0) {
        return 1 - resistance/200
    } else if (resistance >=0 && resistance < 75){
        return 1 - resistance/100
    } else {
        return 1/(1+resistance/100*4)
    }
}

function df(youLv=90, eLv=90, td){
    return (100+youLv)/(100+youLv+(100+eLv)*(td? (100-td)/100 : 1))
}

function jt(k){
    if(k == 0){return 1}
    return 1 + Math.log(0.99316499 + 0.00209988607 * k + 0.0000001213236971*k*k)
}
